﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Talento21.Modelo;

namespace Talento21.Negocio.Servicio
{
    public class SrvNivelEmp
    {
        SysGestion21Entities db;

        public SrvNivelEmp()
            : this(new SysGestion21Entities())
        {

        }

        public SrvNivelEmp(SysGestion21Entities context)
        {
            db = context;
        }

        public void Crear(InfNivelCompetenciaEmp nivelCompetenciaEmp)
        {
            db.AddToInfNivelCompetenciaEmp(nivelCompetenciaEmp);
            db.SaveChanges();
        }

        public List<InfNivelCompetenciaEmp> ObtenerNiveles()
        {
            return new List<InfNivelCompetenciaEmp>();
        }


        public List<InfNivelCompetenciaEmp> ObtenerNivelesPorIdCompetencia(int idCompetencia)
        {
            return (from niveles in db.InfNivelCompetenciaEmp where niveles.Id_Competencia == idCompetencia select niveles).ToList();
        }
    }
}